package com.budwk.app.sqfw.models;

import com.budwk.starter.common.openapi.annotation.ApiModel;
import com.budwk.starter.common.openapi.annotation.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;

import java.io.Serializable;
import java.time.LocalDateTime;

/**
 * 创建数据库表时默认更新字段值，只需集成即可
 */
@Data
@Accessors(chain = true)
public class BaseEntityModel {

    @Column("create_id")
    @Comment("创建人")
    @ApiModelProperty(description = "create_id")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String createId;

    @Column("create_date")
    @Comment("创建时间")
    @ApiModelProperty(description = "创建时间")
    @ColDefine(type = ColType.DATETIME)
    private LocalDateTime createDate;

    @Column("update_id")
    @Comment("更新人")
    @ApiModelProperty(description = "更新人")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String updateId;

    @Column("update_date")
    @Comment("更新时间")
    @ApiModelProperty(description = "更新时间")
    @ColDefine(type = ColType.DATETIME)
    private LocalDateTime updateDate;
}
